<#noparse>
<#include "./common/include.ftl" /></#noparse>
<#noparse>
<#include "./common/toolbar.ftl" /></#noparse>
<!DOCTYPE HTML>
<html lang="zh_CN">
<head>
	<title>&nbsp;</title>
	<meta content="text/html;charset=UTF-8" http-equiv="content-type">
</head>
<body>
<div id="home3" class="easyui-layout" data-options="fit:true">
	<div id="home3NorthBody" data-options="region:'north'">
		<form id="searchForm" style="margin: 0;">
			<div style="display: none;">
				<input id="moduleid" name="moduleid">
			</div>
			<ul class="search-form">
            <#noparse>
				<#--
				<
				li class="search-form-li">
				编号
				<input id="paramSn" class="easyui-textbox" name="paramSn" style="width: 100px;">
				</li>
			<li class="search-form-li">
				名称
				<!-- <input id="paramIname" class="easyui-textbox" name="paramIname" style="width:200px;"> &ndash;&gt;
                <input id="paramOrgId" class="easyui-textbox" name="paramOrgId" style="width: 200px;">
            </li>
            <li class="search-form-li">
                联系人
                <input id="paramContactPerson" class="easyui-textbox" name="paramContactPerson" style="width: 120px;">
            </li>
            <li class="search-form-li">
                联系电话
                <input id="paramContactPhone" class="easyui-textbox easyui-numberbox" name="paramContactPhone" style="width: 120px;">
            </li>-->
            </#noparse>
				<li class="search-form-li">
					<a id="submitSearch" class="search-form-btn ccrfid-search" href="javascript:void(0)"></a>
				</li>
			</ul>
		</form>
	</div>
	<div id="home3CenterBody" data-options="region:'center'">
		<table id="list_data"></table>
	</div>
</div>
</body>
<script type="text/javascript" charset="UTF-8" src="/js/common/toolbar.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/common/tree-util.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/common/validatebox-util.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/common/commonComponent.js"></script>
<script type="text/javascript">
	var queryParams = {};
	$(function () {
		/**********工具条**********/
		contextPath = "";
		getToolbar(contextPath, "<#noparse>${moduleid}</#noparse>");

		commonComponent.orgCombogrid({
			id: "paramOrgId",
			queryParams: {
				typeId: commonComponent.constant.factoryTypeId,
				paramState: 4
			}
		});
		/**********数据网格**********/
		$("#list_data").datagrid({
			method: "GET",
			url: "/${url}/list",
			autoRowHeight: false,
			ctrlSelect: true,
			fit: true,
			idField: "id",
			pagination: true,
			resizeable: true,
			rownumbers: true,
			pageSize: 20,
			singleSelect: false,
			striped: true,
			toolbar: "#ccms-toolbar",
			frozenColumns: [[
				{field: "ck", checkbox: true}
			]],
			<#--<#list me.entityInfo.propTypes.entrySet as entry>-->
				<#--${entry.key}-->
			<#--</#list>-->
			columns: [[
				{field: "id", hidden: true},
				<#list me.entityInfo.propTypes?keys as key>
					{field: "${key}", title: "${me.entityInfo.propRemarks[key]}", width: 100, align: "center"},
				</#list>
				{
					field: "operate", title: "操作", width: 150, align: "center",
					formatter: function (value, rowData, rowIndex) {
						return rowTools(value, rowData, rowIndex);
					}
				}
			]],
			onLoadSuccess: function (data) {
				loadRowBar(data);
				$("#list_data").datagrid("clearSelections");
			}
		});
	});
	/**
	 * 保存成功时
	 */
	function whenSaveSuccess(id, data, win) {
		$.messager.progress("close");
		if (null != data) {
			if (data.code == "validation-fail") {
				$.messager.alert("提示", data.message + JSON.stringify(data.data));
				return;
			}
			if (data.success) {
				win.window("close");
				$("#list_data").datagrid("reload");
				showMessage(data.message);
				return;
			} else {
				$.messager.alert("提示", data.message);
				return;
			}
		}
		$.messager.alert("提示", "操作失败！");
	}
	/**
	 * 删除成功时
	 */
	function whenDelSuccess(ids, data) {
		if (null != data) {
			if (data.success) {
				$("#list_data").datagrid("reload");
				showMessage(data.message);
				return;
			}
		}
		$("#list_data").datagrid("reload");
		$.messager.alert("提示", "操作失败！");
	}
</script>
</html>